(function () {
    'use strict';

    var app = angular.module('LoginControllers', []);

    app.controller('LoginController', ['$scope', 'authService', '$state', 'loginInfo',
        function ($scope, authService, $state, loginInfo) {
            $scope.user = {};
            $scope.user.account = 'bingo';
            $scope.user.password = 'bingo';
            $scope.login = function () {
                authService.login($scope.user.account, $scope.user.password, function (login) {
                    if (login) {
                        //$location.path('/Desktop');
                        $state.go('Home.Desktop');
                    }
                    else {
                        alert("登陆失败");
                    }
                });
            };

            $scope.IntroOptions = {
                steps: [
                    {
                        element: '#step1',
                        intro: "先输入账号！",
                        position: 'bottom'
                    },
                    {
                        element: '#step2',
                        intro: "<strong>然后输入密码！</strong>",
                        position: 'bottom'
                    },
                    {
                        element: '#step3',
                        intro: "点击这里登录",
                        position: 'top'
                    }
                ],
                showStepNumbers: true,
                exitOnOverlayClick: false,
                exitOnEsc: false,
                nextLabel: '<strong>下一步!</strong>',
                prevLabel: '<strong>上一步</strong>',
                skipLabel: '退出',
                doneLabel: '谢谢！'
            };

            $scope.ShouldAutoStart = function () {
//            return !loginInfo.isLoggedIn;
                return false;
            }
        }]);
})();